<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="webwork" prefix="s"%>
<%@ taglib uri="/tld/common.tld" prefix="co"%>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
.field-error,.field-error ul,.field-error li,.action-error,.action-error ul,.action-error li,.action-message,.action-message ul,.action-message li
	{
	display: inline;
}

.field-error li,.action-error li,.action-message li {
	list-style: none;
}

.field-error li,.action-error li {
	color: red;
}

.action-message li {
	color: green;
}

table {
	width: 100%;
}
</style>
</head>
<body>
	<s:actionerror />
	<s:actionmessage />
	<form action="userList.do" method="get">
		<input type="hidden" name="userQuery.execute" value="1" />
		<co:paramKeeper name="_m, _sn" />
		<s:set name="isSelectMode" value="#parameters._m != null && #parameters._m[0] == \"1\""/>
		<table>
			<tbody>
				<tr>
					<td><s:i18n name="com.fzy.auth.entity.User">
							<s:text name="name" />
						</s:i18n>
					</td>
					<td><s:textfield name="userQuery.name" />
					</td>
				</tr>
			</tbody>
		</table>
		<table>
			<tbody>
				<tr>
					<td align="right">
						<s:if test="!#isSelectMode">
						<s:url id="urlInput" action="userInput" />
						<s:a href="%{urlInput}">
							<s:text name="text.add" />
						</s:a>
						</s:if>
						<input type="submit" value="<s:text name="text.query" />" />
						</td>
				</tr>
			</tbody>
		</table>
		<table>
			<thead>
				<tr>
					<s:if test="#isSelectMode">
						<td><s:text name="text.select" /></td>
					</s:if>
					<td><s:i18n name="com.fzy.auth.entity.User">
							<s:text name="name" />
						</s:i18n></td>
					<td><s:i18n name="com.fzy.auth.entity.User">
							<s:text name="password" />
						</s:i18n></td>
					<td><s:i18n name="com.fzy.auth.entity.User">
							<s:text name="nickname" />
						</s:i18n></td>
					<td><s:text name="text.operation" /></td>
				</tr>
			</thead>
			<s:if test="list.size > 0">
				<tbody>
					<s:iterator value="list" id="vo">
						<tr>
							<s:if test="#isSelectMode">
								<td><input type="radio" name="_sv"
									value="<s:property value="#vo.id" />" /></td>
							</s:if>
							<td><s:property value="#vo.name" /></td>
							<td><s:property value="#vo.password" /></td>
							<td><s:property value="#vo.nickname" /></td>
							<td>
							<s:if test="!#isSelectMode">
								<s:url id="urlInput" action="userInput">
									<s:param name="id">
										<s:property value="#vo.id" />
									</s:param>
								</s:url> <s:a href="%{urlInput}">
									<s:text name="text.modify" />
								</s:a>
							</s:if>
							</td>
						</tr>
					</s:iterator>
				</tbody>
			</s:if>
		</table>
		<s:if test="#isSelectMode && list.size > 0">
			<input type="submit" value="<s:text name="text.select" />" />
		</s:if>
	</form>
</body>
</html>